<!--
 * @Author: taosong 2289713738@qq.com
 * @Date: 2023-12-19 20:39:50
 * @LastEditors: taosong 2289713738@qq.com
 * @LastEditTime: 2023-12-19 20:53:40
 * @FilePath: \vue3.0-study\src\example\attribute\components\attributeSon.vue
 * @Description: 
 * 
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
-->
<script setup lang="ts">
import { useAttrs } from 'vue'

defineProps({
  name: {
    type: String,
    default: 'taosong'
  }
})

defineOptions({
  // 这样就不会绑定了
  inheritAttrs: false
})

// 拿到所有透传
const attrs = useAttrs()
console.log('所有透传属性', attrs)
</script>

<template>
  <div class="attribute">{{ $attrs.age }}</div>
</template>

<style lang="scss" scoped></style>
